<?php
require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('goodsorder');

require_once "function.php";
$orderid=htmlspecialchars($orderid);

$sql = "SELECT  * FROM `#@__order_log` where orderid='$orderid'  AND latitude!=''  ";
		
	$dosql->Execute($sql,8);
	$order_arr=array();
	$oder_info=array();
	$jindu_arr=array();
	while($row = $dosql->GetArray(8))
	{
		if($row['jiedan']=='true'){
			$jindu_arr[]='jie';
			$op_name='接单';
		}elseif($row['qiandao']=='true'){
			$jindu_arr[]='qian';
			$op_name='签到';
		}else{
			$jindu_arr[]='over';
			$op_name='完修';
		}
		
		
		$order_arr[]=$row['latitude'].",".$row['longitude'];
	    $oder_info[]="<h2 class='school_name'>".getManage($row['manageid'])."     ".$op_name. "</h2><br/>操作时间：".date("Y-m-d H:i:s",$row['op_time'])."<br/><a href='ordershow.php?id=".$orderid."' class='btn btn-success' >返回</a>";

	}

?>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>中泓高科 报修运行概况</title>
<meta http-equiv="refresh" content="60">
<link href="templates/style/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="templates/js/jquery.min.js"></script>
<script type="text/javascript" src="templates/js/listajax.js"></script>
<script type="text/javascript" src="templates/js/forms.func.js"></script>
<script type="text/javascript" src="templates/js/loadimage.js"></script>
<script type="text/javascript" src="templates/js/getarea.js"></script>
<script type="text/javascript" src="layer/layer.js"></script>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="ui/css/bootstrap.min.css">
<link rel="stylesheet" href="ui/css/bootstrap-theme.min.css" >
<script src="ui/js/bootstrap.min.js" ></script>
<style type="text/css">
* { margin: 0px; padding: 0px; }
body, button, input, select, textarea { font: 12px/16px Verdana, Helvetica, Arial, sans-serif; }
#container { min-width: 600px; min-height: 767px; z-index: 999; }
.school_name { font-size: 20px; margin: 0; color: #930; }
#container h1 { position:relative; top:10px; width:380px; font-size:20px; height: 40px; line-height: 40px; text-align: center; margin: 0 auto 10px auto;z-index: 9999; background:url(img/ver.png);color:#FFF; }
.data_box { width: 220px; height: 400px; position: absolute; right: 10px; top: 120px; background: url(img/ver.png); z-index: 9999; border-radius: 10px;  }
.data_box h2 { height: 40px; line-height: 40px; color: #FFF; font-size: 20px; }
.data_conn{ width:190px; margin:0 auto; color:#FFF;}
.data_conn img{ width:32px; height:32px; margin-right:10px;}
.table-bordered{ border:#39F !important;}
</style>
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=IYNBZ-YNYWG-IE6QE-IQPNJ-J3HKV-BVBTX"></script>
<script>


function init() {
    var center = new qq.maps.LatLng(<?php echo $order_arr[0]?>);
    var map = new qq.maps.Map(document.getElementById("container"), {
        center: center,
        zoom: 15
    });
    var infoWin = new qq.maps.InfoWindow({
        map: map
    });

    var latlngs = [
	<?php 
		foreach($order_arr as $key=>$val){
			echo " new qq.maps.LatLng(".$val."),";
		}
	?>
    ];
	
    var polyline = new qq.maps.Polyline({
        path: latlngs,
        strokeColor: '#f10129',
        strokeWeight: 5,
        editable:false,
        map: map
    });
	
	
	
	//订单信息
	var oder_info=<?php echo  json_encode($oder_info);?>;
	var order_list = eval(oder_info);
	//进度 
	var jindu_arr=<?php echo  json_encode($jindu_arr);?>;
	var jindu_arr = eval(jindu_arr);
    var anchor = new qq.maps.Point(6, 6),
        size = new qq.maps.Size(32, 32),
        origin = new qq.maps.Point(0, 0);
    for(var i = 0;i < latlngs.length; i++) {
        (function(n){
            var marker = new qq.maps.Marker({
                position: latlngs[n],
                map: map,
				icon:  new qq.maps.MarkerImage('img/'+jindu_arr[n]+'.png', size, origin, anchor)
            });
            qq.maps.event.addListener(marker, 'click', function() {
                infoWin.open();
                infoWin.setContent(order_list[n]);
                infoWin.setPosition(latlngs[n]);
            });
        })(i);
    }
}
</script>
</head>
<body onload="init();">

<div id="container">
<h1>中泓高科 任务轨迹</h1>
</div>
</body>
</html>
